Skip to content

Support weight sharing in QNN GPU#2325

Open
vjatoth-qti wants to merge 8 commits into
microsoft:mainfrom
CodeLinaro:dev/vjatoth-qti/qnn-gpu-weight-sharing
Open

Support weight sharing in QNN GPU#2325
vjatoth-qti wants to merge 8 commits into
microsoft:mainfrom
CodeLinaro:dev/vjatoth-qti/qnn-gpu-weight-sharing

Conversation

@vjatoth-qti

Copy link
Copy Markdown

Describe your changes

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass.
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.

(Optional) Issue link

Comment thread olive/passes/onnx/static_llm.py Fixed
Comment thread olive/passes/onnx/static_llm.py Fixed
Comment thread olive/passes/onnx/static_llm.py
@vjatoth-qti vjatoth-qti force-pushed the dev/vjatoth-qti/qnn-gpu-weight-sharing branch from 0c0236a to 24f1374 Compare March 1, 2026 09:11
Comment thread olive/passes/onnx/static_llm.py
Comment thread olive/passes/onnx/context_binary.py Outdated
@jambayk

jambayk commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

changing to draft since there has been no update on this PR since feb

@jambayk jambayk marked this pull request as draft April 9, 2026 16:45
@unnim-qti unnim-qti force-pushed the dev/vjatoth-qti/qnn-gpu-weight-sharing branch from 24f1374 to b4fc7bb Compare April 12, 2026 22:14
@vjatoth-qti vjatoth-qti marked this pull request as ready for review May 29, 2026 18:01
Copilot AI review requested due to automatic review settings May 29, 2026 18:01
Comment thread olive/passes/onnx/static_llm.py Outdated
Comment thread olive/passes/onnx/static_llm.py Outdated
@unnim-qti unnim-qti force-pushed the dev/vjatoth-qti/qnn-gpu-weight-sharing branch from 9b2ce4d to e36e46b Compare June 5, 2026 10:08
@unnim-qti unnim-qti force-pushed the dev/vjatoth-qti/qnn-gpu-weight-sharing branch from e36e46b to 8c99b76 Compare June 6, 2026 21:23
Comment thread olive/passes/onnx/common.py Outdated
Co-authored-by: qti-mattsinc <mattsinc@qti.qualcomm.com>
Comment thread olive/cache.py
# filename matches what genai_config.json references.
actual_output_dir = output_dir
model_file_name = "model"
model_file_name = Path(onnx_file_name).stem if has_additional_files and onnx_file_name else "model"

@qti-mattsinc qti-mattsinc Jun 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we tried using resave_model in update_llm_pipeline_genai_config_gpu analogously to how it's used in the NPU path, instead of changing this file?

@unnim-qti unnim-qti Jul 7, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Matthew,

Based on my understanding, the resave function stores files in the destination cache. In the QNN GPU workflow, when the context_iterator_models split is disabled, a single ONNX model is generated instead of a composite model, unlike the HTP workflow.

In this scenario, the _save_model function in cache.py saves the ONNX file to the destination output directory with the hardcoded name "model.onnx". However, this is inconsistent with the naming convention used in genai_config, where the model is named "model_ctx" after the ctx_gen pass.

To keep the naming consistent with genai_config, I updated cache.py so that the file is saved as "model_ctx" instead of model. This aligns the output produced with the expected GenAI configuration naming convention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants